﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ProviderDetail.aspx.cs" Inherits="WXYW.ProviderDetail" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="Ajax" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    代理商资料
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ButtonPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="RightContentPlaceHolder" runat="server">
    <div class="buttonHeader" align="right">
        <img src="image/operateicon/back_back.gif" alt="" />
        <asp:LinkButton ID="BackHyperLink" runat="server" PostBackUrl="~/ManageProvider.aspx">返回</asp:LinkButton>
    </div>
    <div style="width: 100%">
        <Ajax:TabContainer ID="ProviderInfoTabContainer" runat="server" ActiveTabIndex="2"
            Width="100%" 
            OnActiveTabChanged="ProviderInfoTabContainer_ActiveTabChanged">
            <Ajax:TabPanel runat="server" HeaderText="基本信息" ID="BasicInfoTabPanel">
                <ContentTemplate>
                    <table cellpadding="0px" cellspacing="0px" style="width: 100%">
                        <tr>
                            <td style="background-color: #f5f5f5; width: 20px;">
                            </td>
                            <td style="background-color: #ffffff;">
                                <table style="height: 100%;">
                                    <tr>
                                        <td style="width: 100px">
                                            代理商代码：
                                        </td>
                                        <td style="width: 150px">
                                            <asp:TextBox ID="codeTxtBox" runat="server" Width="150px"></asp:TextBox>
                                        </td>
                                        <td style="width: 5px">
                                            <asp:RequiredFieldValidator ID="codeRequiredValidator" runat="server" ErrorMessage="请输入代理商代码；"
                                                Text="*" ControlToValidate="codeTxtBox" ValidationGroup="NewProviderValidation"></asp:RequiredFieldValidator>
                                        </td>
                                        <td style="width: 100px">
                                            代理商名称：
                                        </td>
                                        <td style="width: 150px">
                                            <asp:TextBox ID="nameTxtBox" runat="server" Width="150px"></asp:TextBox>
                                        </td>
                                        <td style="width: 5px">
                                            <asp:RequiredFieldValidator ID="nameRequiredFieldValidator" runat="server" ErrorMessage="请输入代理商名称；"
                                                Text="*" ControlToValidate="nameTxtBox" ValidationGroup="NewProviderValidation"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 100px">
                                            产品类型：
                                        </td>
                                        <td style="width: 150px">
                                            <asp:DropDownList ID="productTypeDropdownList" runat="server" Width="150px" Height="20px">
                                            </asp:DropDownList>
                                        </td>
                                        <td style="width: 5px">
                                        </td>
                                        <td style="width: 100px">
                                            关系：
                                        </td>
                                        <td style="width: 150px">
                                            <asp:TextBox ID="relationTxtBox" runat="server" Width="150px"></asp:TextBox>
                                        </td>
                                        <td style="width: 5px">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 100px">
                                            所属城市：
                                        </td>
                                        <td style="width: 150px">
                                            <asp:TextBox ID="cityTxtBox" runat="server" Width="150px"></asp:TextBox>
                                        </td>
                                        <td style="width: 5px">
                                            <asp:RequiredFieldValidator ID="cityRequiredFieldValidator" runat="server" ErrorMessage="请输入所属城市；"
                                                Text="*" ControlToValidate="cityTxtBox" ValidationGroup="NewProviderValidation"></asp:RequiredFieldValidator>
                                        </td>
                                        <td style="width: 100px">
                                            邮编：
                                        </td>
                                        <td style="width: 150px">
                                            <asp:TextBox ID="postcodeTxtBox" runat="server" Width="150px"></asp:TextBox>
                                        </td>
                                        <td style="width: 5px">
                                            <asp:RequiredFieldValidator ID="postcodeRequiredFieldValidator" runat="server" ErrorMessage="请输入邮编；"
                                                Text="*" ControlToValidate="postcodeTxtBox" ValidationGroup="NewProviderValidation"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 100px">
                                            通讯地址：
                                        </td>
                                        <td colspan="4">
                                            <asp:TextBox ID="addressTxtBox" runat="server" Width="470px"></asp:TextBox>
                                        </td>
                                        <td style="width: 5px">
                                            <asp:RequiredFieldValidator ID="addressRequiredFieldValidator" runat="server" ErrorMessage="请输入通讯地址；"
                                                Text="*" ControlToValidate="addressTxtBox" ValidationGroup="NewProviderValidation"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 100px">
                                            接口人1：
                                        </td>
                                        <td style="width: 150px">
                                            <asp:TextBox ID="contact1TxtBox" runat="server" Width="150px"></asp:TextBox>
                                        </td>
                                        <td style="width: 5px">
                                            <asp:RequiredFieldValidator ID="contact1RequiredFieldValidator" runat="server" ErrorMessage="请输入接口人1的名称；"
                                                Text="*" ControlToValidate="contact1TxtBox" ValidationGroup="NewProviderValidation"></asp:RequiredFieldValidator>
                                        </td>
                                        <td style="width: 100px">
                                            联系电话：
                                        </td>
                                        <td style="width: 150px">
                                            <asp:TextBox ID="phone1TxtBox" runat="server" Width="150px"></asp:TextBox>
                                        </td>
                                        <td style="width: 5px">
                                            <asp:RequiredFieldValidator ID="phone1RequiredFieldValidator" runat="server" ErrorMessage="请输入接口人1的联系电话；"
                                                Text="*" ControlToValidate="phone1TxtBox" ValidationGroup="NewProviderValidation"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            联系手机：
                                        </td>
                                        <td>
                                            <asp:TextBox ID="mobilePhone1TxtBox" runat="server" Width="150px"></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:RequiredFieldValidator ID="mobilePhone1RequiredFieldValidator" runat="server"
                                                ErrorMessage="请输入接口人1的联系手机；" Text="*" ControlToValidate="mobilePhone1TxtBox"
                                                ValidationGroup="NewProviderValidation"></asp:RequiredFieldValidator>
                                        </td>
                                        <td>
                                            联系传真：
                                        </td>
                                        <td>
                                            <asp:TextBox ID="fax1TxtBox" runat="server" Width="150px"></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:RequiredFieldValidator ID="fax1RequiredFieldValidator" runat="server" ErrorMessage="请输入接口人1的联系传真；"
                                                Text="*" ControlToValidate="fax1TxtBox" ValidationGroup="NewProviderValidation"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            邮箱：
                                        </td>
                                        <td colspan="4">
                                            <asp:TextBox ID="email1TxtBox" runat="server" Width="150px"></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:RequiredFieldValidator ID="email1RequiredFieldValidator" runat="server" ErrorMessage="请输入接口人1的邮箱；"
                                                Text="*" ControlToValidate="email1TxtBox" ValidationGroup="NewProviderValidation"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            接口人2：
                                        </td>
                                        <td>
                                            <asp:TextBox ID="contact2TxtBox" runat="server" Width="150px"></asp:TextBox>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                            联系电话：
                                        </td>
                                        <td>
                                            <asp:TextBox ID="phone2TxtBox" runat="server" Width="150px"></asp:TextBox>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            联系手机：
                                        </td>
                                        <td>
                                            <asp:TextBox ID="mobilePhone2TxtBox" runat="server" Width="150px"></asp:TextBox>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                            联系传真：
                                        </td>
                                        <td>
                                            <asp:TextBox ID="fax2TxtBox" runat="server" Width="150px"></asp:TextBox>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            邮箱：
                                        </td>
                                        <td colspan="4">
                                            <asp:TextBox ID="email2TxtBox" runat="server" Width="150px"></asp:TextBox>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr style="text-align: center">
                                        <td colspan="6">
                                            <asp:Button ID="SaveButton" runat="server" Text="保存更新" ValidationGroup="NewProviderValidation"
                                                OnClick="SaveButton_Click" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="5">
                                            <asp:Label ID="messageLbl" runat="server" ForeColor="Red"></asp:Label>
                                            <asp:ValidationSummary ID="ValidationSummary" runat="server" ValidationGroup="NewProviderValidation" />
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td style="background-color: #f5f5f5; width: 20px;">
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </Ajax:TabPanel>
            <Ajax:TabPanel runat="server" HeaderText="备件" ID="SparePartTabPanel">
                <HeaderTemplate>
                    备件
                </HeaderTemplate>
                <ContentTemplate>
                    <asp:MultiView ID="SparePartMultiView" runat="server" ActiveViewIndex="0">
                        <asp:View ID="SparePartListView" runat="server">
                            <asp:Button ID="NewSparePartButton" runat="server" Text="新增备件" CausesValidation="False"
                                OnClick="NewSparePartButton_Click1" />
                            <asp:GridView ID="SparePartGridView" runat="server" AutoGenerateColumns="False" CssClass="tableList"
                                Width="100%" OnRowCommand="SparePartGridView_RowCommand" OnRowDataBound="SparePartGridView_RowDataBound">
                                <Columns>
                                    <asp:BoundField DataField="ModelNumber" HeaderText="产品型号">
                                        <ItemStyle Wrap="False" HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="VersionNumber" HeaderText="版本号">
                                        <ItemStyle Wrap="False" HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="数量" DataField="Count">
                                        <ItemStyle Wrap="False" HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="提供时间" DataField="LastUpdate">
                                        <ItemStyle Wrap="False" HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:TemplateField HeaderText="查看记录" ShowHeader="False">
                                        <ItemTemplate>
                                            <img src="image/operateicon/docview.gif" alt="" />
                                            <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="false" CommandName="LookSparePart"
                                                Text="查看" CommandArgument='<%#Eval("ID") %>'></asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="退回" ShowHeader="False">
                                        <ItemTemplate>
                                            <img src="image/operateicon/back_back.gif" alt="" />
                                            <asp:LinkButton ID="BackSparePartLinkButton" runat="server" CausesValidation="false"
                                                CommandName="BackSparePart" Text="退回" CommandArgument='<%#Eval("ID") %>'></asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </asp:View>
                        <asp:View ID="SparePartRecordsView" runat="server">
                            <asp:LinkButton ID="BackSparePartListLnkBtn" runat="server" Text="返回备件列表" OnClick="BackSparePartListLnkBtn_Click"></asp:LinkButton>
                            <asp:GridView ID="SparePartRecordGridView" runat="server" AutoGenerateColumns="False"
                                CssClass="tableList" Width="100%" OnRowCommand="SparePartRecordGridView_RowCommand"
                                OnRowDataBound="SparePartRecordGridView_RowDataBound">
                                <Columns>
                                    <asp:BoundField HeaderText="产品型号" DataField="ModelNumber">
                                        <HeaderStyle Wrap="False" />
                                        <ItemStyle HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="版本号" DataField="VersionNumber">
                                        <HeaderStyle Wrap="False" />
                                        <ItemStyle HorizontalAlign="Left" Wrap="False" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="数量" DataField="Count">
                                        <HeaderStyle Wrap="False" />
                                        <ItemStyle HorizontalAlign="Center" Wrap="False" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="操作类型" DataField="OperationType">
                                        <HeaderStyle Wrap="False" />
                                        <ItemStyle HorizontalAlign="Center" Wrap="False" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="操作日期" DataField="OperationDatetime">
                                        <HeaderStyle Wrap="False" />
                                        <ItemStyle HorizontalAlign="Center" Wrap="False" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="操作人员" DataField="Operator">
                                        <HeaderStyle Wrap="False" />
                                        <ItemStyle HorizontalAlign="Left" Wrap="False" />
                                    </asp:BoundField>
                                </Columns>
                            </asp:GridView>
                        </asp:View>
                    </asp:MultiView>
                    <Ajax:ModalPopupExtender ID="NewSparePartPopupExtender" TargetControlID="BackSparePartHiddenField"
                        PopupControlID="NewSparePartPanel" BackgroundCssClass="modalBackground" runat="server"
                        Drag="True" PopupDragHandleControlID="dragBar" DynamicServicePath="" Enabled="True"
                        CancelControlID="CloseNewSparePartButton">
                    </Ajax:ModalPopupExtender>
                    <asp:Panel ID="NewSparePartPanel" CssClass="modalPopup" Width="500px" runat="server"
                        DefaultButton="SaveSparePartButton">
                        <!-- Header -->
                        <div class="box-header" id="dragBar">
                            <img src="image/stdBox_left_top.gif" alt="" />
                            <h2>
                                新增备件</h2>
                        </div>
                        <div class="functionPanel">
                            <table>
                                <tr style="height: 30px;">
                                    <td style="width: 100px">
                                        产品型号：
                                    </td>
                                    <td colspan="4">
                                        <asp:TextBox ID="ModelNOTxtBox" runat="server" Width="300px"></asp:TextBox>
                                    </td>
                                    <td style="width: 10px">
                                        <asp:RequiredFieldValidator ID="ModelNOValidator" runat="server" ErrorMessage="请输入产品型号；"
                                            Text="*" ControlToValidate="ModelNOTxtBox" ValidationGroup="SparePartValidation"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr style="height: 30px;">
                                    <td style="width: 80px">
                                        版本号：
                                    </td>
                                    <td style="width: 100px">
                                        <asp:TextBox ID="VersionNOTextBox" runat="server" Width="100px"></asp:TextBox>
                                    </td>
                                    <td style="width: 10px">
                                        <asp:RequiredFieldValidator ID="VersionNORequiredFieldValidator" runat="server" ErrorMessage="请输入版本号；"
                                            Text="*" ControlToValidate="VersionNOTextBox" ValidationGroup="SparePartValidation"></asp:RequiredFieldValidator>
                                    </td>
                                    <td style="width: 80px">
                                        提供数量：
                                    </td>
                                    <td style="width: 100px">
                                        <asp:TextBox ID="CountTextBox" runat="server" Width="100px"></asp:TextBox>
                                    </td>
                                    <td style="width: 10px">
                                        <asp:RequiredFieldValidator ID="CountRequiredFieldValidator" runat="server" ErrorMessage="请输入提供数量；"
                                            Text="*" ControlToValidate="CountTextBox" ValidationGroup="SparePartValidation"></asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator ID="CountValidator2" runat="server" ErrorMessage="请输入合法的提供数量；"
                                            Text="*" ValidationExpression="^[0-9]+$" ControlToValidate="CountTextBox" ValidationGroup="SparePartValidation"></asp:RegularExpressionValidator>
                                    </td>
                                </tr>
                                <tr style="text-align: center; height: 30px;">
                                    <td colspan="6">
                                        <asp:Button ID="SaveSparePartButton" runat="server" Text="新增备件" OnClick="NewSparePartButton_Click"
                                            ValidationGroup="SparePartValidation" />
                                        <asp:Button ID="CloseNewSparePartButton" runat="server" Text="退出" CausesValidation="False" />
                                    </td>
                                </tr>
                                <tr style="height: 30px;">
                                    <td colspan="6">
                                        <asp:Label ID="NewSparePartMsgLbl" runat="server" ForeColor="Red"></asp:Label>
                                        <asp:ValidationSummary ID="NewSparePartValidationSummary" DisplayMode="SingleParagraph"
                                            runat="server" ValidationGroup="SparePartValidation" />
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div class="box-footer">
                            <img alt="" src="image/stdBox_left_bottom.gif" />
                            <p>
                                &nbsp;</p>
                        </div>
                    </asp:Panel>
                    <asp:HiddenField ID="BackSparePartHiddenField" runat="server" />
                    <Ajax:ModalPopupExtender ID="BackSparePartModalPopupExtender" TargetControlID="BackSparePartHiddenField"
                        PopupControlID="BackSparePartPanel" BackgroundCssClass="modalBackground" runat="server"
                        Drag="True" PopupDragHandleControlID="BackSparePartDragBar" DynamicServicePath=""
                        Enabled="True" CancelControlID="CloseBackSparePartButton">
                    </Ajax:ModalPopupExtender>
                    <asp:Panel ID="BackSparePartPanel" CssClass="modalPopup" Width="500px" runat="server"
                        DefaultButton="SaveSparePartButton">
                        <!-- Header -->
                        <div class="box-header" id="BackSparePartDragBar">
                            <img src="image/stdBox_left_top.gif" alt="" />
                            <h2>
                                退回备件</h2>
                        </div>
                        <div class="functionPanel">
                            <table>
                                <tr style="height: 30px;">
                                    <td style="width: 100px">
                                        产品型号：
                                    </td>
                                    <td colspan="4">
                                        <asp:TextBox ID="BackSparePartModelNOTextBox" runat="server" Width="300px" Enabled="False"></asp:TextBox>
                                    </td>
                                    <td style="width: 10px">
                                    </td>
                                </tr>
                                <tr style="height: 30px;">
                                    <td style="width: 80px">
                                        版本号：
                                    </td>
                                    <td style="width: 100px">
                                        <asp:TextBox ID="BackSparePartVersionNOTextBox" runat="server" Width="100px" Enabled="False"></asp:TextBox>
                                    </td>
                                    <td style="width: 10px">
                                    </td>
                                    <td style="width: 80px">
                                        退回数量：
                                    </td>
                                    <td style="width: 100px">
                                        <asp:TextBox ID="BackCountTextBox" runat="server" Width="100px"></asp:TextBox>
                                    </td>
                                    <td style="width: 10px">
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="请输入提供数量；"
                                            Text="*" ControlToValidate="BackCountTextBox" ValidationGroup="BackSparePartValidation"></asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="请输入合法的提供数量；"
                                            Text="*" ValidationExpression="^[0-9]+$" ControlToValidate="BackCountTextBox"
                                            ValidationGroup="BackSparePartValidation"></asp:RegularExpressionValidator>
                                    </td>
                                </tr>
                                <tr style="text-align: center; height: 30px;">
                                    <td colspan="6">
                                        <asp:Button ID="SaveBackSparePartButton" runat="server" Text="退回备件" ValidationGroup="BackSparePartValidation"
                                            OnClick="SaveBackSparePartButton_Click" />
                                        <asp:Button ID="CloseBackSparePartButton" runat="server" Text="关闭" CausesValidation="False" />
                                    </td>
                                </tr>
                                <tr style="height: 30px;">
                                    <td colspan="6">
                                        <asp:Label ID="BackSparePartMsgLabel" runat="server" ForeColor="Red"></asp:Label>
                                        <asp:ValidationSummary ID="ValidationSummary2" DisplayMode="SingleParagraph" runat="server"
                                            ValidationGroup="SparePartValidation" />
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div class="box-footer">
                            <img alt="" src="image/stdBox_left_bottom.gif" />
                            <p>
                                &nbsp;</p>
                        </div>
                    </asp:Panel>
                </ContentTemplate>
            </Ajax:TabPanel>
            <Ajax:TabPanel runat="server" HeaderText="元器件" ID="AccessoryTabPanel">
                <ContentTemplate>
                    <asp:MultiView ID="AccessoryMultiView" runat="server" ActiveViewIndex="0">
                        <asp:View ID="AccessoryListView" runat="server">
                            <asp:Button ID="AddAccessoryButton" runat="server" Text="新增元器件" CausesValidation="False"
                                OnClick="AddAccessoryButton_Click" />
                            <asp:GridView ID="AccessoryListGridView" runat="server" AutoGenerateColumns="False"
                                CssClass="tableList" Width="100%" OnRowCommand="AccessoryListGridView_RowCommand"
                                OnRowDataBound="AccessoryListGridView_RowDataBound" 
                                EnableModelValidation="True">
                                <Columns>
                                    <asp:BoundField DataField="ModelNumber" HeaderText="元器件名称">
                                        <ItemStyle Wrap="False" HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="数量" DataField="Count">
                                        <ItemStyle Wrap="False" HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="成本价格" DataField="Price">
                                        <ItemStyle Wrap="False" HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="客户价格" DataField="CustomerPrice">
                                        <ItemStyle Wrap="False" HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="提供时间" DataField="LastUpdate" DataFormatString="{0:g}">
                                        <ItemStyle Wrap="False" HorizontalAlign="Left" />
                                    </asp:BoundField>
                                      <asp:TemplateField HeaderText="是否可用？">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="statusChkBox" runat="server" Checked="true" ToolTip='<%#Eval("ID") %>' 
                                                AutoPostBack="true" oncheckedchanged="statusChkBox_CheckedChanged"/>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="查看记录" ShowHeader="False">
                                        <ItemTemplate>
                                            <img src="image/operateicon/docview.gif" alt="" />
                                            <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="false" CommandName="LookSparePart"
                                                Text="查看" CommandArgument='<%#Eval("ID") %>'></asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="退回" ShowHeader="False">
                                        <ItemTemplate>
                                            <img src="image/operateicon/back_back.gif" alt="" />
                                            <asp:LinkButton ID="BackAccessoryLinkButton" runat="server" CausesValidation="false"
                                                CommandName="BackAccessory" Text="退回" CommandArgument='<%#Eval("ID") %>'></asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>    
                            </asp:GridView>
                            <p><font style=" color:Red">“是否可用”如果选中，该零件会出现在维修零件可选列表中，不选中，则不会出现。</font></p>
                        </asp:View>
                        <asp:View ID="AccessoryRecordView" runat="server">
                            <asp:LinkButton ID="BackAccessoryListLinkButton" runat="server" Text="返回元器件列表" OnClick="BackAccessoryListLinkButton_Click"></asp:LinkButton>
                            <asp:GridView ID="AccessoryRecordGridView" runat="server" AutoGenerateColumns="False"
                                CssClass="tableList" Width="100%" OnRowCommand="AccessoryRecordGridView_RowCommand"
                                OnRowDataBound="AccessoryRecordGridView_RowDataBound" 
                                EnableModelValidation="True">
                                <Columns>
                                    <asp:BoundField HeaderText="元器件名称" DataField="ModelNumber">
                                        <HeaderStyle Wrap="False" />
                                        <ItemStyle HorizontalAlign="Left" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="数量" DataField="Count">
                                        <HeaderStyle Wrap="False" />
                                        <ItemStyle HorizontalAlign="Center" Wrap="False" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="操作类型" DataField="OperationType">
                                        <HeaderStyle Wrap="False" />
                                        <ItemStyle HorizontalAlign="Center" Wrap="False" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="操作日期" DataField="OperationDatetime">
                                        <HeaderStyle Wrap="False" />
                                        <ItemStyle HorizontalAlign="Center" Wrap="False" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="操作人员" DataField="Operator">
                                        <HeaderStyle Wrap="False" />
                                        <ItemStyle HorizontalAlign="Left" Wrap="False" />
                                    </asp:BoundField>
                                </Columns>
                            </asp:GridView>
                        </asp:View>
                    </asp:MultiView>
                    <Ajax:ModalPopupExtender ID="AddAccessoryModalPopupExtender" TargetControlID="AccessoryHiddenField"
                        PopupControlID="NewAccessoryPanel" BackgroundCssClass="modalBackground" runat="server"
                        Drag="True" PopupDragHandleControlID="NewAccessoryDragbar" DynamicServicePath=""
                        Enabled="True" CancelControlID="CloseNewAccessoryButton">
                    </Ajax:ModalPopupExtender>
                    <asp:Panel ID="NewAccessoryPanel" CssClass="modalPopup" Width="300px" runat="server"
                        DefaultButton="SaveNewAccessoyButton">
                        <!-- Header -->
                        <div class="box-header" id="NewAccessoryDragbar">
                            <img src="image/stdBox_left_top.gif" alt="" />
                            <h2>
                                新增元器件</h2>
                        </div>
                        <div class="functionPanel">
                            <table>
                                <tr style="height: 30px;">
                                    <td style="width: 100px">
                                        元器件名称：
                                    </td>
                                    <td>
                                        <asp:TextBox ID="NewAccessoryNameTextBox" runat="server" Width="150px"></asp:TextBox>
                                    </td>
                                    <td style="width: 10px">
                                        <asp:RequiredFieldValidator ID="AccessoryNameRequiredFieldValidator" runat="server"
                                            ErrorMessage="请输入元器件名称；" Text="*" ControlToValidate="NewAccessoryNameTextBox"
                                            ValidationGroup="NewAccessoryValidation"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr style="height: 30px;">
                                    <td style="width: 80px">
                                        提供数量：
                                    </td>
                                    <td style="width: 100px">
                                        <asp:TextBox ID="NewAccessoryCountTextBox" runat="server" Width="150px"></asp:TextBox>
                                    </td>
                                    <td style="width: 10px">
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="请输入提供数量；"
                                            Text="*" ControlToValidate="NewAccessoryCountTextBox" ValidationGroup="NewAccessoryValidation"></asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="请输入合法的提供数量；"
                                            Text="*" ValidationExpression="^[0-9]+$" ControlToValidate="NewAccessoryCountTextBox"
                                            ValidationGroup="NewAccessoryValidation"></asp:RegularExpressionValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 80px">
                                        成本价格：
                                    </td>
                                    <td style="width: 100px">
                                        <asp:TextBox ID="PriceTxtBox" runat="server" Width="150px"></asp:TextBox>
                                    </td>
                                    <td style="width: 10px">
                                        <asp:RequiredFieldValidator ID="PriceRequiredFieldValidator" runat="server"
                                            Display="Dynamic" Text="请输入合法的价格" ControlToValidate="PriceTxtBox" 
                                            ValidationGroup="NewAccessoryValidation"></asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator ID="PriceValidator" runat="server"
                                            Text="请输入合法的价格" ValidationExpression="^\-?[0-9]*\.?[0-9]*$" ControlToValidate="PriceTxtBox"
                                            ValidationGroup="NewAccessoryValidation"></asp:RegularExpressionValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 80px">
                                        客户价格：
                                    </td>
                                    <td style="width: 100px">
                                        <asp:TextBox ID="CustomerPriceTxtBox" runat="server" Width="150px"></asp:TextBox>
                                    </td>
                                    <td style="width: 10px">
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                                            Display="Dynamic" Text="请输入合法的价格" ControlToValidate="CustomerPriceTxtBox" 
                                            ValidationGroup="NewAccessoryValidation"></asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server"
                                            Text="请输入合法的价格" ValidationExpression="^\-?[0-9]*\.?[0-9]*$" ControlToValidate="CustomerPriceTxtBox"
                                            ValidationGroup="NewAccessoryValidation"></asp:RegularExpressionValidator>
                                    </td>
                                </tr>
                                <tr style="text-align: center; height: 30px;">
                                    <td colspan="3">
                                        <asp:Button ID="SaveNewAccessoyButton" runat="server" Text="新增元器件" ValidationGroup="NewAccessoryValidation"
                                            OnClick="SaveNewAccessoyButton_Click" />
                                        <asp:Button ID="CloseNewAccessoryButton" runat="server" Text="退出" CausesValidation="False" />
                                    </td>
                                </tr>
                                <tr style="height: 30px;">
                                    <td colspan="3">
                                        <asp:Label ID="AddAccessoryMsgLbl" runat="server" ForeColor="Red"></asp:Label>
                                        <asp:ValidationSummary ID="AddAccessoryValidationSummary" DisplayMode="SingleParagraph"
                                            runat="server" ValidationGroup="SparePartValidation" />
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div class="box-footer">
                            <img alt="" src="image/stdBox_left_bottom.gif" />
                            <p>
                                &nbsp;</p>
                        </div>
                    </asp:Panel>
                    <asp:HiddenField ID="AccessoryHiddenField" runat="server" />
                    <Ajax:ModalPopupExtender ID="BackAccessoryModalPopupExtender" TargetControlID="AccessoryHiddenField"
                        PopupControlID="BackAccessoryPanel" BackgroundCssClass="modalBackground" runat="server"
                        Drag="True" PopupDragHandleControlID="BackAccessoryDragbar" DynamicServicePath=""
                        Enabled="True" CancelControlID="CloseBackAccessoryButton">
                    </Ajax:ModalPopupExtender>
                    <asp:Panel ID="BackAccessoryPanel" CssClass="modalPopup" Width="300px" runat="server"
                        DefaultButton="SaveBackAccessoryButton">
                        <!-- Header -->
                        <div class="box-header" id="BackAccessoryDragbar">
                            <img src="image/stdBox_left_top.gif" alt="" />
                            <h2>
                                退回元器件</h2>
                        </div>
                        <div class="functionPanel">
                            <table>
                                <tr style="height: 30px;">
                                    <td style="width: 100px">
                                        元器件名称：
                                    </td>
                                    <td>
                                        <asp:TextBox ID="BackAccessoryNameTextBox" runat="server" Width="150px" Enabled="False"></asp:TextBox>
                                    </td>
                                    <td style="width: 10px">
                                    </td>
                                </tr>
                                <tr style="height: 30px;">
                                    <td style="width: 80px">
                                        退回数量：
                                    </td>
                                    <td style="width: 100px">
                                        <asp:TextBox ID="BackAccessoryCountTextBox" runat="server" Width="100px"></asp:TextBox>
                                    </td>
                                    <td style="width: 10px">
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="请输入退回数量；"
                                            Text="*" ControlToValidate="BackAccessoryCountTextBox" ValidationGroup="BackAccessoryValidation"></asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ErrorMessage="请输入合法的退回数量；"
                                            Text="*" ValidationExpression="^[0-9]+$" ControlToValidate="BackAccessoryCountTextBox"
                                            ValidationGroup="BackAccessoryValidation"></asp:RegularExpressionValidator>
                                    </td>
                                </tr>
                                <tr style="text-align: center; height: 30px;">
                                    <td colspan="3">
                                        <asp:Button ID="SaveBackAccessoryButton" runat="server" Text="退回元器件" ValidationGroup="BackAccessoryValidation"
                                            OnClick="SaveBackAccessoryButton_Click" />
                                        <asp:Button ID="CloseBackAccessoryButton" runat="server" Text="关闭" CausesValidation="False" />
                                    </td>
                                </tr>
                                <tr style="height: 30px;">
                                    <td colspan="3">
                                        <asp:Label ID="BackAccessoryMsgLabel" runat="server" ForeColor="Red"></asp:Label>
                                        <asp:ValidationSummary ID="BackAccessoryValidationSummary" DisplayMode="SingleParagraph"
                                            runat="server" ValidationGroup="BackAccessoryValidation" />
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div class="box-footer">
                            <img alt="" src="image/stdBox_left_bottom.gif" />
                            <p>
                                &nbsp;</p>
                        </div>
                    </asp:Panel>
                </ContentTemplate>
            </Ajax:TabPanel>
            <Ajax:TabPanel runat="server" HeaderText="报价单" ID="PriceTabPanel">
                <ContentTemplate>
                    <asp:GridView ID="PriceGridView" runat="server" CssClass="tableList" Width="100%"
                        AutoGenerateColumns="False" OnRowCommand="PriceGridView_RowCommand" OnRowDataBound="PriceGridView_RowDataBound">
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="文件名">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField DataField="LastUpdate" HeaderText="上传日期">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Operator" HeaderText="上传人">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="删除" ShowHeader="False">
                                <ItemTemplate>
                                    <img src="image/operateicon/docdelete.gif" alt="" />
                                    <asp:LinkButton ID="DeleteLnkBtn" runat="server" CausesValidation="false" CommandName="DeleteDocument"
                                        Text="删除" CommandArgument='<%#Eval("ID")%>'></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="操作" ShowHeader="False">
                                <ItemTemplate>
                                    <img src="image/operateicon/docview.gif" alt="" />
                                    <asp:HyperLink ID="OpenLnk" runat="server" Target="_blank">打开</asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <p>
                        上传报价单文件:
                        <asp:FileUpload ID="PriceFileUpload" runat="server" Width="500px" Height="25px" />
                        <asp:Button ID="UploadPriceDocumentButton" runat="server" Text="上传" Width="80px"
                            Height="25px" OnClick="UploadPriceDocumentButton_Click" />
                    </p>
                    <asp:Label ID="PriceMessageLbl" runat="server" ForeColor="Red"></asp:Label>
                </ContentTemplate>
            </Ajax:TabPanel>
            <Ajax:TabPanel runat="server" HeaderText="产品资料" ID="ProductMaterialTabPanel">
                <ContentTemplate>
                    <asp:GridView ID="ProductMaterialGridView" runat="server" CssClass="tableList" Width="100%"
                        AutoGenerateColumns="False" OnRowCommand="ProductMaterialGridView_RowCommand"
                        OnRowDataBound="ProductMaterialGridView_RowDataBound">
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="文件名">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField DataField="LastUpdate" HeaderText="上传日期">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Operator" HeaderText="上传人">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="删除" ShowHeader="False">
                                <ItemTemplate>
                                    <img src="image/operateicon/docdelete.gif" alt="" />
                                    <asp:LinkButton ID="DeleteLnkBtn" runat="server" CausesValidation="false" CommandName="DeleteDocument"
                                        Text="删除" CommandArgument='<%#Eval("ID")%>'></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="操作" ShowHeader="False">
                                <ItemTemplate>
                                    <img src="image/operateicon/docview.gif" alt="" />
                                    <asp:HyperLink ID="OpenLnk" runat="server" Target="_blank">打开</asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <p>
                        上传产品资料:
                        <asp:FileUpload ID="ProductMaterialFileUpload" runat="server" Width="500px" Height="25px" />
                        <asp:Button ID="UploadProductMaterialButton" runat="server" Text="上传" Width="80px"
                            Height="25px" OnClick="UploadProductMaterialButton_Click" />
                    </p>
                    <asp:Label ID="ProductMaterialLabel" runat="server" ForeColor="Red"></asp:Label>
                </ContentTemplate>
            </Ajax:TabPanel>
            <Ajax:TabPanel runat="server" HeaderText="技术资料" ID="TechnologyDocumentTabPanel">
                <ContentTemplate>
                    <asp:GridView ID="TechnologyGridView" runat="server" CssClass="tableList" Width="100%"
                        AutoGenerateColumns="False" OnRowCommand="TechnologyGridView_RowCommand" OnRowDataBound="TechnologyGridView_RowDataBound">
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="文件名">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField DataField="LastUpdate" HeaderText="上传日期">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Operator" HeaderText="上传人">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="删除" ShowHeader="False">
                                <ItemTemplate>
                                    <img src="image/operateicon/docdelete.gif" alt="" />
                                    <asp:LinkButton ID="DeleteLnkBtn" runat="server" CausesValidation="false" CommandName="DeleteDocument"
                                        Text="删除" CommandArgument='<%#Eval("ID")%>'></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="操作" ShowHeader="False">
                                <ItemTemplate>
                                    <img src="image/operateicon/docview.gif" alt="" />
                                    <asp:HyperLink ID="OpenLnk" runat="server" Target="_blank">打开</asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <p>
                        上传技术资料:
                        <asp:FileUpload ID="TechnologyMaterialFileUpload" runat="server" Width="500px" Height="25px" />
                        <asp:Button ID="UploadTechnologyMaterialButton" runat="server" Text="上传" Width="80px"
                            Height="25px" OnClick="UploadTechnologyMaterialButton_Click" />
                    </p>
                    <asp:Label ID="TechnologyMaterialMessageLbl" runat="server" ForeColor="Red"></asp:Label>
                </ContentTemplate>
            </Ajax:TabPanel>
            <Ajax:TabPanel runat="server" HeaderText="维修资料" ID="RepairMaterialTabPanel">
                <ContentTemplate>
                    <asp:GridView ID="RepaireMaterialGridView" runat="server" CssClass="tableList" Width="100%"
                        AutoGenerateColumns="False" OnRowCommand="RepaireMaterialGridView_RowCommand"
                        OnRowDataBound="RepaireMaterialGridView_RowDataBound">
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="文件名">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField DataField="LastUpdate" HeaderText="上传日期">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Operator" HeaderText="上传人">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="删除" ShowHeader="False">
                                <ItemTemplate>
                                    <img src="image/operateicon/docdelete.gif" alt="" />
                                    <asp:LinkButton ID="DeleteLnkBtn" runat="server" CausesValidation="false" CommandName="DeleteDocument"
                                        Text="删除" CommandArgument='<%#Eval("ID")%>'></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="操作" ShowHeader="False">
                                <ItemTemplate>
                                    <img src="image/operateicon/docview.gif" alt="" />
                                    <asp:HyperLink ID="OpenLnk" runat="server" Target="_blank">打开</asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <p>
                        上传维修资料:
                        <asp:FileUpload ID="RepaireMaterialFileUpload" runat="server" Width="500px" Height="25px" />
                        <asp:Button ID="UploadRepaireMaterialButton" runat="server" Text="上传" Width="80px"
                            Height="25px" OnClick="UploadRepaireMaterialButton_Click" />
                    </p>
                    <asp:Label ID="RepairMaterialLabel" runat="server" ForeColor="Red"></asp:Label>
                </ContentTemplate>
            </Ajax:TabPanel>
            <Ajax:TabPanel runat="server" HeaderText="协议" ID="ContractTabPanel">
                <ContentTemplate>
                    <asp:GridView ID="ContractGridView" runat="server" CssClass="tableList" Width="100%"
                        AutoGenerateColumns="False" OnRowCommand="ContractGridView_RowCommand" OnRowDataBound="ContractGridView_RowDataBound">
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="文件名">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField DataField="LastUpdate" HeaderText="上传日期">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Operator" HeaderText="上传人">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="删除" ShowHeader="False">
                                <ItemTemplate>
                                    <img src="image/operateicon/docdelete.gif" alt="" />
                                    <asp:LinkButton ID="DeleteLnkBtn" runat="server" CausesValidation="false" CommandName="DeleteDocument"
                                        Text="删除" CommandArgument='<%#Eval("ID")%>'></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="操作" ShowHeader="False">
                                <ItemTemplate>
                                    <img src="image/operateicon/docview.gif" alt="" />
                                    <asp:HyperLink ID="OpenLnk" runat="server" Target="_blank">打开</asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <p>
                        上传协议文件:
                        <asp:FileUpload ID="ContractFileUpload" runat="server" Width="500px" Height="25px" />
                        <asp:Button ID="UploadContractButton" runat="server" Text="上传" Width="80px" Height="25px"
                            OnClick="UploadContractButton_Click" />
                    </p>
                    <asp:Label ID="ContractMessageLbl" runat="server" ForeColor="Red"></asp:Label>
                </ContentTemplate>
            </Ajax:TabPanel>
            <Ajax:TabPanel runat="server" HeaderText="产品清单" ID="ProductTabPanel">
            </Ajax:TabPanel>
        </Ajax:TabContainer>
    </div>
</asp:Content>
